package com.anyou.mall.goo.goods.service.impl;

import com.anyou.common.utils.DateUtils;
import com.anyou.mall.goo.goods.domain.JfDraw;
import com.anyou.mall.goo.goods.mapper.JfDrawMapper;
import com.anyou.mall.goo.goods.service.IJfDrawService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 积分抽奖设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-13
 */
@Service
public class JfDrawServiceImpl extends ServiceImpl<JfDrawMapper, JfDraw> implements IJfDrawService
{
    @Autowired
    private JfDrawMapper jfDrawMapper;

    /**
     * 查询积分抽奖设置
     * 
     * @param jfDrawId 积分抽奖设置主键
     * @return 积分抽奖设置
     */
    @Override
    public JfDraw selectJfDrawByJfDrawId(Long jfDrawId)
    {
        return jfDrawMapper.selectJfDrawByJfDrawId(jfDrawId);
    }

    /**
     * 查询积分抽奖设置列表
     * 
     * @param jfDraw 积分抽奖设置
     * @return 积分抽奖设置
     */
    @Override
    public List<JfDraw> selectJfDrawList(JfDraw jfDraw)
    {
        return jfDrawMapper.selectJfDrawList(jfDraw);
    }

    /**
     * 新增积分抽奖设置
     * 
     * @param jfDraw 积分抽奖设置
     * @return 结果
     */
    @Override
    public int insertJfDraw(JfDraw jfDraw)
    {
        jfDraw.setCreateTime(DateUtils.getNowDate());
        return jfDrawMapper.insertJfDraw(jfDraw);
    }

    /**
     * 修改积分抽奖设置
     * 
     * @param jfDraw 积分抽奖设置
     * @return 结果
     */
    @Override
    public int updateJfDraw(JfDraw jfDraw)
    {
        jfDraw.setUpdateTime(DateUtils.getNowDate());
        return jfDrawMapper.updateJfDraw(jfDraw);
    }

    /**
     * 批量删除积分抽奖设置
     * 
     * @param jfDrawIds 需要删除的积分抽奖设置主键
     * @return 结果
     */
    @Override
    public int deleteJfDrawByJfDrawIds(Long[] jfDrawIds)
    {
        return jfDrawMapper.deleteJfDrawByJfDrawIds(jfDrawIds);
    }

    /**
     * 删除积分抽奖设置信息
     * 
     * @param jfDrawId 积分抽奖设置主键
     * @return 结果
     */
    @Override
    public int deleteJfDrawByJfDrawId(Long jfDrawId)
    {
        return jfDrawMapper.deleteJfDrawByJfDrawId(jfDrawId);
    }
}
